package com.oop.demo09;

public class Teacher {
    final String name="wwwj";//final修饰字段定义时显示初始化
    final int age; //final修饰字段在构造方法中显示初始化
    final static double PI = 3.14; //结合static定义常量

    public Teacher(int age) {
        this.age = age;
    }

    public void test(){
       // age=20;//Cannot assign a value to final variable 'age',final关键字定义的字段不允许被重新赋值；

    }
}
